package com.lvcoding.cloud.api.feign.factory;

import com.lvcoding.cloud.api.entity.SysUser;
import com.lvcoding.cloud.api.feign.UserFeign;
import com.lvcoding.cloud.common.core.response.Res;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description 描述
 * @Date 2020-07-18 2:59 下午
 * @Author wuyanshen
 */
@Slf4j
public class UserFeignFallbackFactory implements FallbackFactory<UserFeign> {
    @Override
    public UserFeign create(Throwable throwable) {
        log.info("用户服务熔断降级。。。");
        return new UserFeign() {
            @Override
            public Res<SysUser> userInfo(String username) {
                return null;
            }

            @Override
            public String nacos() {
                return "用户服务熔断降级...";
            }

            @Override
            public String nacosOrder() {
                return null;
            }
        };
    }
}
